<h2><?php __('Thống kê phân loại đoàn viên học kỳ '.$hocky);?></h2>
<?php if(!empty($phanloaisvs)):?> 
    <?php 
        if(count($phanloaisvs)>0){
            echo "Xuất sắc: ".$tlxs.'%';
            echo "Khá: ".$tlk.'%';
            echo "Trung bình: ".$tltb.'%';
            echo "Yếu: ".$tly.'%';
            foreach($loaicdsv as $xeploaicd){
             if($loaicd==$xeploaicd['Xeploaicd']['id']) echo "<div>Xếp loại chi đoàn: ".$xeploaicd['Xeploaicd']['loaicd']."</div>";   
            }
        }else {
            echo "Chưa phân loại sinh viên!";
        }
        
    ?>
	<table cellpadding="0" cellspacing="0">
    <tr>    
            <th><?php  __('STT');?></th>
            <th><?php 
                    __('Đã duyệt');
            ?></th>
            <th><?php 
                    __('Chưa duyệt');
            ?></th>
			<th><?php  __('Xếp loại');?></th>
			<th><?php __('MSSV');?></th>
			<th><?php __('Họ Tên');?></th>
            <th><?php __('Điểm RL');?></th>
            <th><?php __('Điểm TBHK');?></th>
            <th><?php __('Số phong trào sinh viên');?></th>
            <th><?php __('Số phong trào khoa');?></th>
            <th><?php __('Ghi chú');?></th>
            
			<!--removed <th class="actions"><?php __('Actions');?></th>-->
            
	</tr>
	<?php
	$i = 0;
    $j=1;    
	foreach ($phanloaisvs as $phanloaisv):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
        <td><?php echo $i;?></td> 
        <td><?php if($phanloaisv['Z5plsv']['duyet']==0) echo "X";?></td>
        <td><?php if($phanloaisv['Z5plsv']['duyet']==1) echo "X";?></td>   
		<td>
			<?php 
                foreach($xeploais as $xeploai)
                if($xeploai['Xeploai']['id']==$phanloaisv['Z5plsv']['xeploai_id'])echo $xeploai['Xeploai']['tenloai'];//echo $form->input('xeploai_id'.$j,array('type'=>'select','label'=>'','options'=>$xeploais,'default'=>$phanloaisv['Z5plsv']['xeploai_id'])); 
            ?>
		</td>
        <td><?php echo $phanloaisv['Z5plsv']['mssv']; ?></td>
        <td><?php echo $phanloaisv['Z5plsv']['hoten']; ?></td>
		<td><?php echo $phanloaisv['Z5plsv']['diemrenluyen']; ?>&nbsp;</td>
		<td><?php echo $phanloaisv['Z5plsv']['diemtbhk']; ?>&nbsp;</td>
        <td><?php echo $this->Html->link(__($phanloaisv['Z5plsv']['slcd'], true), array('controller'=>'thanhtichsvs','action' => 'viewtt', $phanloaisv['Z5plsv']['sinhvien_id'])); ?>&nbsp;</td>
        <td><?php echo $this->Html->link(__($phanloaisv['Z5plsv']['slkhoa'], true), array('controller'=>'thanhtichkhoasvs','action' => 'viewtt', $phanloaisv['Z5plsv']['sinhvien_id'])); ?>&nbsp;</td>
        <td><?php echo $phanloaisv['Z5plsv']['ghichu']; ?>&nbsp;</td>
        <!-- Removed
		<td class="actions">        
			<?php echo $this->Html->link(__('View', true), array('action' => 'view', $phanloaisv['Z5plsv']['sinhvien_id'])); ?>
			<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $phanloaisv['Z5plsv']['sinhvien_id'])); ?>
			<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $phanloaisv['Z5plsv']['sinhvien_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $phanloaisv['Z5plsv']['sinhvien_id'])); ?>
		</td>
        -->
	</tr>
    <?php $j++;?>
<?php endforeach; ?>
	</table>
    <h2>Kết quả bình xét đoàn viên ưu tú: </h2>
    <table cellpadding="0" cellspacing="0">
    <?php if(count($dvutsvs)!=0):?>   
	<tr>
            <th><?php __('STT');?></th>
			<th><?php __('MSSV');?></th>
            <th><?php __('Họ tên');?></th>
			<th><?php __('Số người đồng ý');?></th>
			<th><?php __('Ghi chú');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($dvutsvs as $dvutsv):
    $i++;		
	?>
	<tr<?php echo $class;?>>
        <td><?php echo $i;?></td>
        <td><?php echo $dvutsv['Z1dvutsv']['mssv'];?></td>
        <td><?php echo $dvutsv['Z1dvutsv']['hoten'];?></td>
		<td><?php echo $dvutsv['Z1dvutsv']['songuoidongy'].'/'.$dvutsv['Z1dvutsv']['songuoithamgiabau'];?>&nbsp;</td>
        <td><?php echo $dvutsv['Z1dvutsv']['ghichu'];?></td>	
	</tr>
    <?php endforeach; ?>
    <?php else:?>
    <?php echo "Chưa có";?>
    <?php endif;?>
    </table>
<?php else:?>
    <?php echo "Chưa bình xét đoàn viên ưu tú!";?>
<?php endif;?>         